package edu.szu.huhanpeng.doodlingFight.model 
{
	import edu.szu.huhanpeng.doodlingFight.model.data.ScoreData;
	import org.puremvc.as3.interfaces.INotifier;
	import org.puremvc.as3.interfaces.IProxy;
	import org.puremvc.as3.patterns.proxy.Proxy;
	
	/**
	 * ...
	 * @author Huhanpeng
	 */
	public class ScoreProxy extends Proxy implements IProxy, INotifier 
	{
		public static const NAME:String = "ScoreProxy";
		
		public function ScoreProxy() 
		{
			super( NAME );
		}
		
		public function calculate(count:int):void 
		{
			scoreData.point += count; 
			scoreData.score += scoreData.point;
		}
		
		public function get owner():int
		{
			return scoreData.owner;
		}
		
		public function clean():void 
		{
			scoreData.point = 0;
		}
		
		public function get score():int 
		{
			return scoreData.score;
		}
		
		protected function get scoreData():ScoreData
		{
			return data as ScoreData;
		}
		
	}

}